#include "guiterm.hpp"
#ifndef CHARACTERGRID_HPP
#define CHARACTERGRID_HPP

class CharacterGrid :public QObject
{
	Q_OBJECT
public:
	CharacterGrid(int width);
	virtual ~CharacterGrid();
	
	virtual void finish();
	int getWidth() const;
	int getHeight() const;
	virtual void setWidth(int width)=0;
	virtual void setHeight(int height)=0;
	virtual int getChar(int col, int row) const=0;
	virtual QColor getForeColor(int col, int row) const;
	virtual QColor getBackColor(int col, int row) const;
	virtual int heightForWidth(int width, bool abridged) const=0;
	virtual void setScroll(int value)=0;
	
signals:
	void rectDirtied(int left, int top, int width, int height);
	void heightChanged();
	void cursorMoved(int col, int row);
	void scrollbarChanged(int min, int max, int value);
	
protected:
	int width;
};

#endif
